<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <!-- <input type="text" name="" id="in"> -->
    <script>
        // var input = document.getElementById("in")
        // var startime = new Date().getTime()
        // input.oninput = function () {
        //     var endTime = new Date().getTime()
        //     if ((endTime - startime) / 1000 > 1) {
        //         startime = new Date().getTime()
        //         console.log(input.value)
        //     }
        // }
        function tot(fn, delay) {
            var startime = new Date().getTime()
            return function () {
                var endtime = new Date().getTime()
                if ((endtime - startime) / 1000 > delay) {
                    fn()
                    startime = new Date().getTime()
                }
            }
        }
        document.onclick = tot(function () {
            console.log("我裂开了")
        }, 1)
    </script>
</body>

</html>